//
//  UUProductUtility.m
//  UUCharterSupplier
//
//  Created by ZhangAo on 26/02/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import "UUProductUtility.h"
#import <UUFoundation/UUPersistenceManager.h>
#import "UUProductManager.h"

@implementation UUProductUtility

+ (NSMutableDictionary *)productDefaults {
    return GetPersistenceManager().userPrivateDefaults;
}

+ (NSDictionary *)convertProductSpecModelToFormDict:(UUProductSpecModel *)productSpecModel {
    NSMutableDictionary *formDict = [[productSpecModel toDictionary] mutableCopy];
    
    UUProductPackageModel *package = [GetProductManager() fetchProductPackageModelWithPackageId:productSpecModel.packageId];
    [formDict setObject:@(package.isHalfDay) forKey:@"is_half_day"];
    [formDict setObject:package.name forKey:@"name"];
    
    return formDict;
}

@end
